package main

import (
	"context"
	"order/biz/service"
	order "order/kitex_gen/order"
)

// OrderServiceImpl implements the last service interface defined in the IDL.
type OrderServiceImpl struct{}

// AddOrder implements the OrderServiceImpl interface.
func (s *OrderServiceImpl) AddOrder(ctx context.Context, req *order.AddOrder) (resp *order.AddOrder, err error) {
	resp, err = service.NewAddOrderService(ctx).Run(req)

	return resp, err
}

// DeleteOrder implements the OrderServiceImpl interface.
func (s *OrderServiceImpl) DeleteOrder(ctx context.Context, req *order.DeleteOrder) (resp *order.DeleteOrder, err error) {
	resp, err = service.NewDeleteOrderService(ctx).Run(req)

	return resp, err
}

// GetOrder implements the OrderServiceImpl interface.
func (s *OrderServiceImpl) GetOrder(ctx context.Context, req *order.GetOrder) (resp *order.GetOrder, err error) {
	resp, err = service.NewGetOrderService(ctx).Run(req)

	return resp, err
}

// UpdateOrder implements the OrderServiceImpl interface.
func (s *OrderServiceImpl) UpdateOrder(ctx context.Context, req *order.UpdateOrder) (resp *order.UpdateOrder, err error) {
	resp, err = service.NewUpdateOrderService(ctx).Run(req)

	return resp, err
}
